-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix foreign assets migration #3190
Conversation
WASM runtime size check:Compared to target branchMoonbase runtime: 2420 KB (+4 KB) 🚨 Moonbeam runtime: 2400 KB (-8 KB) ✅ Moonriver runtime: 2400 KB (+16 KB) Compared to latest release (runtime-3500)Moonbase runtime: 2420 KB (+468 KB compared to latest release) 🚨 Moonbeam runtime: 2400 KB (+464 KB compared to latest release) Moonriver runtime: 2400 KB (+464 KB compared to latest release) |
Coverage Report@@ Coverage Diff @@
## master rq/fix-foreign-assets-migration +/- ##
===================================================================
- Coverage 74.52% 74.48% -0.04%
Files 380 380
+ Lines 96102 96174 +72
===================================================================
+ Hits 71611 71626 +15
+ Misses 24491 24548 +57
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RomarQ, the changes look good. I would rerun the benchmarks to account for additional metadata read and write. For that you need to update the migrate_approval benchmark scenario and ensure metadata is added to the owner account.
The weights for this call are good enough, just tried it locally, it is fine to keep it as is. The changes do not affect PoV. |
* fix: foreign assets migration * fix: warnings * remove used method * update hard-coded gas limits to a reasonable value * fix test * improve code
* fix: foreign assets migration * fix: warnings * remove used method * update hard-coded gas limits to a reasonable value * fix test * improve code
What does it do?
Fixes the foreign assets migration.
The fix has been dry-run on the following networks:
What is being fixed?
When migrating approvals, some calls require calling the contract with the
approval owner (a smart-contract in this case)
origin, which is not allowed, only EOA can perform external calls. In the case of this migration this must be allowed.The mint fails because in some situations, the target address is the burn address (0x0000...). In this scenarios, the migration should skip the minting.
The gas limit provided when creating the erc-20 was not big enough.